export default {
  methods: {
    // 判断是否有登录
    isLogin () {
      if (!this.token) {
        this.$dialog.confirm({
          title: '温馨提示',
          message: '您需要登录才能操作噢~',
          confirmButtonText: '去登录',
          cancelButtonText: '再逛逛',
          confirmButtonColor: '#2aaaff',
          width: '70%',
          theme: 'round'
        }).then(() => {
          // console.log(this.$route)
          this.$router.replace(`/login?backUrl=${this.$route.fullPath}`)
        }).catch(() => {
          this.$router.replace('/home')
        })
        return false
      }
      return true
    }
  }
}
